Merged
Conversation
🦋 Changeset detectedLatest commit: 92563eb The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes critical race conditions in session management that could lead to incorrect session operations and data corruption.
Key Changes:
- Modified
renameSessionto accept an explicitsessionIdparameter to prevent renaming the wrong session whenthis.sessionIdchanges during async operations - Enhanced
destroy()method to clearcurrentTaskIdandsessionGitUrlto prevent session data clobbering across tasks - Updated
syncSession()to capture and use a stablesessionIdvalue throughout its execution
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/shared/kilocode/cli-sessions/core/SessionManager.ts |
Added explicit sessionId parameter to renameSession, captured local sessionId in syncSession for race-free operations, and cleared currentTaskId/sessionGitUrl in destroy |
src/shared/kilocode/cli-sessions/core/__tests__/SessionManager.test.ts |
Updated test expectations for new renameSession signature and added comprehensive test case validating currentTaskId clearing prevents session clobbering |
cli/src/commands/session.ts |
Updated renameSession call to pass explicit sessionId parameter and added early validation for active session |
markijbema
reviewed
Dec 4, 2025
markijbema
approved these changes
Dec 4, 2025
This was referenced Dec 4, 2025
Merged
This was referenced Dec 5, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes a couple race conditions:
this.sessionIdchangingtaskIdnot being reset